package org.example.controller;

import org.example.model.DBtype;
import org.example.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import java.util.List;


@RestController
public class YmlController {

    @Value("${demo.key1}")
    private String key1;

    @Value("${demo.key2}")
    private String key2;

    @Value("${demo.key3}")
    private String key3;

    @Value("${string.str1}")
    private String str1;

    @Value("${string.str2}")
    private String str2;

    @Value("${string.str3}")
    private String str3;

    @Autowired
    private Student student;

    @Autowired
    private DBtype dBtype;

    @RequestMapping("/readYml")
    public String readYml() {
        return key1;
    }
    @PostConstruct
    public void init() {
       /* System.out.println("key1: " + key1);
        System.out.println("key2: " + key2);
        System.out.println("key3: " + key3);
        System.out.println(key3 == null);
        System.out.println("str1: " + str1);
        System.out.println("str2: " + str2);
        System.out.println("str3: " + str3);
        System.out.println("student" + student);
        System.out.println("dbtype: " + dBtype);*/
    }
}
